
func void B_KillNpc(var int npcInstance)
{
	var C_Npc npc;
	npc = Hlp_GetNpc(npcInstance);
	if(Hlp_IsValidNpc(npc) && !Npc_IsDead(npc))
	{
		npc.flags = 0;
		if(npc.guild == GIL_ORC)
		{
			B_GiveDeathInv(npc);
		}
		else if(npc.guild == GIL_DRAGON)
		{
			B_GiveDeathInv(npc);
		}
		else if(npc.guild == GIL_ZOMBIE)
		{
			B_GiveDeathInv(npc);
		}
		else
		{
			CreateInvItem(npc,ItMi_OldCoin);
		};
		Npc_ChangeAttribute(npc,ATR_HITPOINTS,-npc.attribute[ATR_HITPOINTS_MAX]);
	};
};

func void b_changeguild(var int npcInstance,var int npcguild)
{
	var C_Npc npc;
	npc = Hlp_GetNpc(npcInstance);
	npc.guild = npcguild;
	Npc_SetTrueGuild(npc,npcguild);
};

func void b_changehp(var C_Npc npc)
{
	if(Hlp_IsValidNpc(npc) && !Npc_IsDead(npc))
	{
		npc.attribute[ATR_HITPOINTS] = 50;
	};
};

func void b_changeoverride(var C_Npc npc)
{
	if(Hlp_IsValidNpc(npc) && !Npc_IsDead(npc))
	{
		if(npc.aivar[AIV_EnemyOverride] == TRUE)
		{
			npc.aivar[AIV_EnemyOverride] = FALSE;
		}
		else
		{
			npc.aivar[AIV_EnemyOverride] = TRUE;
		};
	};
};

func void b_changestatustocandead(var C_Npc npc)
{
	if(Hlp_IsValidNpc(npc) && !Npc_IsDead(npc))
	{
		if(npc.aivar[93] == TRUE)
		{
			npc.aivar[93] = FALSE;
		};
	};
};

func void b_killnpc_now(var int npcInstance)
{
	var C_Npc npc;
	npc = Hlp_GetNpc(npcInstance);
	Npc_ChangeAttribute(npc,ATR_HITPOINTS,-npc.attribute[ATR_HITPOINTS_MAX]);
};

